perm filename APP4.TEX[UHF,DEK]1 blob sn#841395 filedate 1987-01-28 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00008 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	% (macros edited from TWIMAC)
C00015 00003	\pageno=19
C00017 00004	\N5.  Inputting and outputting the data.
C00026 00005	\N15.  Dot diffusion.
C00033 00006	\N19.  Computing the diffusion tables.
C00042 00007	\N26.  The main program.
C00043 00008	\bigskip\noindent{\bf Acknowledgements.}\quad
C00056 ENDMK
C⊗;
% (macros edited from TWIMAC)
\newdimen\em \em=10pt
\parskip 0pt % no stretch between paragraphs
\parindent 1\em % for paragraphs and for the first line of Pascal text

\font\manual=manfnt
\font\ninerm=cmr9
\font\eightrm=cmr8
\font\sixrm=cmr6
\font\ninei=cmmi9
\font\eighti=cmmi8
\font\sixi=cmmi6
\skewchar\ninei='177 \skewchar\eighti='177 \skewchar\sixi='177
\font\ninesy=cmsy9
\font\eightsy=cmsy8
\font\sixsy=cmsy6
\skewchar\ninesy='60 \skewchar\eightsy='60 \skewchar\sixsy='60
\font\ninebf=cmbx9
\font\eightbf=cmbx8
\font\sixbf=cmbx6
\font\ninett=cmtt9
\font\eighttt=cmtt8
\hyphenchar\ninett=-1 \hyphenchar\eighttt=-1
\font\ninesl=cmsl9
\font\eightsl=cmsl8
\font\nineit=cmti9
\font\eightit=cmti8

\newif\iftenpoint
\def\tenpoint{\tenpointtrue
 \def\rm{\fam0\tenrm}%
  \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
  \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\tenit}%
  \textfont\itfam=\tenit
  \def\sl{\fam\slfam\tensl}%
  \textfont\slfam=\tensl
  \def\bf{\fam\bffam\tenbf}%
  \textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\tentt}%
  \textfont\ttfam=\tentt
  \def\ttx{\tentex}%
  \normalbaselineskip=12pt
  \def\MF{{\manual META}\-{\manual FONT}}%
  \let\sc=\eightrm
  \let\big=\tenbig
  \setbox\strutbox=\hbox{\vrule height8pt depth3pt width 0pt}%
  \normalbaselines\rm}

\def\ninepoint{\tenpointfalse
 \def\rm{\fam0\ninerm}%
  \textfont0=\ninerm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  \textfont1=\ninei \scriptfont1=\sixi \scriptscriptfont1=\fivei
  \textfont2=\ninesy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\nineit}%
  \textfont\itfam=\nineit
  \def\sl{\fam\slfam\ninesl}%
  \textfont\slfam=\ninesl
  \def\bf{\fam\bffam\ninebf}%
  \textfont\bffam=\ninebf \scriptfont\bffam=\sixbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\ninett}%
  \textfont\ttfam=\ninett
  \def\ttx{\ninetex}%
  \normalbaselineskip=11pt
  \def\MF{{\manual hijk}\-{\manual lmnj}}%
  \let\sc=\sevenrm
  \let\big=\ninebig
  \setbox\strutbox=\hbox{\vrule height8pt depth3pt width 0pt}%
  \normalbaselines\rm}

\def\eightpoint{%
 \def\rm{\fam0\eightrm}%
  \textfont0=\eightrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  \textfont1=\eighti \scriptfont1=\sixi \scriptscriptfont1=\fivei
  \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\eightit}%
  \textfont\itfam=\eightit
  \def\sl{\fam\slfam\eightsl}%
  \textfont\slfam=\eightsl
  \def\bf{\fam\bffam\eightbf}%
  \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\eighttt}%
  \textfont\ttfam=\eighttt
  \def\ttx{\eighttex}%
  \normalbaselineskip=9pt
  \def\MF{{\manual opqr}\-{\manual stuq}}%
  \let\sc=\sixrm
  \let\big=\eightbig
  \setbox\strutbox=\hbox{\vrule height7pt depth2pt width 0pt}%
  \normalbaselines\rm}

\def\tenbig#1{{\hbox{$\left#1\vbox to8.5pt{}\right.\nulldelimiterspace=0pt$}}}
\def\ninebig#1{{\hbox{$\textfont0=\tenrm\textfont2=\tensy
  \left#1\vbox to7.25pt{}\right.\nulldelimiterspace=0pt$}}}
\def\eightbig#1{{\hbox{$\textfont0=\ninerm\textfont2=\ninesy
  \left#1\vbox to6.5pt{}\right.\nulldelimiterspace=0pt$}}}

\font\tentex=cmtex10
\font\ninetex=cmtex9 % TeX extended character set (used in strings)
\font\eighttex=cmtex8

\def\\#1{\hbox{\it#1\/\kern.05em}} % italic type for identifiers
\def\|#1{\hbox{$#1$}} % one-letter identifiers look a bit better this way
\def\{\hbox{\bf#1\/}} % boldface type for reserved words
\def\.#1{\hbox{\ttx % typewriter type for strings
  \let\\=\BS % backslash in a string
  \let\'=\RQ % right quote in a string
  \let\`=\LQ % left quote in a string
  \let\{=\LB % left brace in a string
  \let\}=\RB % right brace in a string
  \let\~=\TL % tilde in a string
  \let\ =\SP % space in a string
  \let\_=\UL % underline in a string
  \let\&=\AM % ampersand in a string
  #1}}
\def\#{\hbox{\tt\char`\#}} % parameter sign
\def\${\hbox{\tt\char`\$}} % dollar sign
\def\%{\hbox{\tt\char`\%}} % percent sign
\def\↑{\ifmmode\mathchar"222 \else\char`↑ \fi} % pointer or hat
% circumflex accents can be obtained from \↑↑D instead of \↑
\def\AT!{@} % at sign for control text

\chardef\AM=`\& % ampersand character in a string
\chardef\BS=`\\ % backslash in a string
\chardef\LB=`\{ % left brace in a string
\def\LQ{{\tt\char'22}} % left quote in a string
\chardef\RB=`\} % right brace in a string
\def\RQ{{\tt\char'23}} % right quote in a string
\def\SP{{\tt\char`\ }} % (visible) space in a string
\chardef\TL=`\~ % tilde in a string
\chardef\UL=`\_ % underline character in a string

\newbox\bak \setbox\bak=\hbox to -\em{} % backspace one em
\newbox\bakk\setbox\bakk=\hbox to -2\em{} % backspace two ems

\newcount\ind % current indentation in ems
\def\1{\global\advance\ind by1\hangindent\ind\em} % indent one more notch
\def\2{\global\advance\ind by-1} % indent one less notch
\def\3#1{\hfil\penalty#10\hfilneg} % optional break within a statement
\def\4{\copy\bak} % backspace one notch
\def\5{\hfil\penalty-1\hfilneg\kern2.5\em\copy\bakk\ignorespaces}%optional break
\def\6{\ifmmode\else\par % forced break
  \hangindent\ind\em\noindent\kern\ind\em\copy\bakk\ignorespaces\fi}
\def\7{\Y\6} % forced break and a little extra space

\let\yskip=\smallskip
\def\to{\mathrel{.\,.}} % double dot, used only in math mode
\def\ellipsis{\kern5\em\smash{\vdots}\qquad\vbox to12pt{}\par}
\def\note#1#2.{\par\penalty5000
  \Y\noindent{\hangindent2\em\baselineskip10pt\eightrm#1 #2.\par}}
\def\startsection{\vskip0pt plus 100pt \penalty-100
  \vskip12pt plus-100pt minus 3pt\Q\noindent\strut{\bf\modno.\quad}\iftrue}
\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format'
\def\A{\note{See also}} % cross-reference for multiply defined section names
\def\B{\mathopen{\.{@\{}}} % begin controlled comment
\def\C#1{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % Pascal comments
  \XX\hfil\penalty-1\hfilneg\quad$\{\,$#1$\,\}$\XX}
\def\D{\defin{define}} % macro definition
\def\E{\cdot10↑} % exponent in floating point constant
\def\F{\defin{format}} % format definition
\let\G=\ge % greater than or equal sign
\def\H#1{\hbox{\rm\char"7D\tt#1}} % hexadecimal constant
\let\I=\ne % unequal sign
\def\J{\.{@\&}} % TANGLE's join operation
\let\K=\gets % left arrow
\let\L=\le % less than or equal sign
\outer\def\M#1.{\def\modno{#1}\startsection\ignorespaces}
\outer\def\N#1. #2.{\def\modno{#1}%
  \startsection{\bf\ignorespaces#2.\quad}\ignorespaces}
\def\O#1{\hbox{\rm\char'23\kern-.2em\it#1\/\kern.05em}} % octal constant
\def\P{\iftenpoint \ninepoint\fi
  \rightskip=0pt plus 100pt minus 10pt % go into Pascal mode
  \sfcode`;=3000
  \pretolerance 10000
  \hyphenpenalty 10000 \exhyphenpenalty 10000
  \global\ind=2 \1\ \unskip}
\def\Q{\tenpoint
  \rightskip=0pt % get out of Pascal mode
  \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 }
\let\R=\lnot % logical not
\let\S=\equiv % equivalence sign
\def\T{\mathclose{\.{@\}}}} % terminate controlled comment
\def\U{\note{This code is used in}} % cross-reference for uses of sections
\let\V=\lor % logical or
\let\W=\land % logical and
\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name
  \XX$\langle\,$#2{\sevenrm\kern.5em#1}$\,\rangle$\XX}
\def\Y{\par\yskip}
\let\Z=\let % now you can \send the control sequence \Z
\def\){\hbox{\.{@\$}}} % sign for string pool check sum
\def\]{\hbox{\.{@\\}}} % sign for forced line break
\def\=#1{\kern2pt\hbox{\vrule\vtop{\vbox{\hrule
        \hbox{\strut\kern2pt\.{#1}\kern2pt}}
      \hrule}\vrule}\kern2pt} % verbatim string
\let\~=\ignorespaces

\pageno=19
\noindent\strut{\bf Appendix 4: Pixel optimization}
\vskip 1pt plus 1pt
\noindent Here is another short {\tt WEB} program. It was used to generate
the special font for Mona Lisa.

\N1.  Introduction.
This program prepares a \MF\ program for a special-purpose font
that will approximate a given picture.
The input is assumed to be a binary file that contains one byte of
density information per pixel.
The output will be a sequence of lines like
$$\hbox{\tt row(10); cols(3,15,16,17);}$$
this means that bits 3, 15, 16, and 17 of the character for row 10 should be black.

\fi

\M2. Here's an outline of the entire Pascal program:

\Y\P\4\&{program}\1\  \37$\\{picfont}(\\{bytes\_in},\39\\{output})$;\6
\4\&{type} \37\X5:Types in the outer block\X\6
\4\&{var} \37\X6:Global variables\X\6
\X10:Basic procedures\X \6
\&{begin} \37\X26:The main program\X;\6
\&{end}.\par
\fi

\M3. The picture in the input data is assumed to contain \\{mm} rows and \\{nn}
columns.

\Y\P\D \37$\\{mm}=512$\C{this many rows}\par
\P\D \37$\\{nn}=440$\C{this many columns}\par
\fi

\M4. It's convenient to declare a macro for incrementation.

\Y\P\D \37$\\{incr}(\#)\S\#\K\#+1$\par
\fi

\N5.  Inputting and outputting the data.
The input appears in a file of 8-bit bytes, with \.{00} representing black
and \.{FF} representing white. There are $mm\times nn$ bytes; they appear in
order from top to bottom and left to right just as we normally read a page
of text.

\Y\P$\4\X5:Types in the outer block\X\S$\6
$\\{eight\_bits}=0\to255$;\C{unsigned one-byte quantity}\6
$\\{byte\_file}=$\1\5
\&{packed} \37\&{file} \1\&{of}\5
\\{eight\_bits};\C{files that contain binary data}\2\2\par
\U section~2.\fi

\M6. \P$\X6:Global variables\X\S$\6
\4\\{bytes\_in}: \37\\{byte\_file};\par
\A sections~9, 14, 16, 22, and~25.
\U section~2.\fi

\M7. Different Pascal systems have different ways of dealing with
binary files. Here is one common way.

\Y\P$\4\X7:Open the input file\X\S$\6
$\\{reset}(\\{bytes\_in},\39\.{\'\'},\39\.{\'/B:8\'})$\par
\U section~26.\fi

\M8. We shall use the following model for estimating the effect of a
given bit pattern: If a pixel is black, the darkness is 1.0; if it
is white but at least one of its four neighbors is black, the darkness
is \\{zeta}; if it is white and has four white neighbors, the darkness
is zero.

\Y\P\D \37$\\{white}=0$\C{code for a white pixel with all white neighbors}\par
\P\D \37$\\{gray}=1$\C{code for a white pixel with 1, 2, 3, or 4 black
neighbors}\par
\P\D \37$\\{black}=2$\C{code for a black pixel}\par
\P\D \37$\\{zeta}\S0.2$\C{assumed darkness of white pixel with a black
neighbor}\par
\fi

\M9. There isn't room to store all the input bytes in memory at once, but
it suffices to keep buffers for about a dozen rows near the current area
being computed.

\Y\P$\4\X6:Global variables\X\mathrel{+}\S$\6
\4\\{ii}: \37\\{integer};\C{the buffer holds rows $8\\{ii}-7$ through $8%
\\{ii}+4$}\6
\4\\{buffer}: \37\&{array} $[-2\to9,\390\to\\{nn}+1]$ \1\&{of}\5
\\{real};\C{densities in twelve current rows}\2\6
\4\\{darkness}: \37\&{array} $[-3\to9,\390\to\\{nn}+1]$ \1\&{of}\5
$\\{white}\to\\{black}$;\C{darknesses in buffer rows}\2\6
\4\\{new\_row}: \37\&{array} $[0\to\\{nn}+1]$ \1\&{of}\5
\\{real};\C{densities in row being input}\2\par
\fi

\M10. The \\{get\_in} procedure computes the densities in a specified row
and puts them in \\{new\_row}. This procedure is called successively for
$\|i=1$, 2,~\dots\thinspace.

\Y\P$\4\X10:Basic procedures\X\S$\6
\4\&{procedure}\1\  \37$\\{get\_in}(\|i:\\{integer})$;\6
\4\&{var} \37\|j: \37\\{integer};\5
\|t: \37\\{eight\_bits};\C{byte of input}\2\6
\&{begin} \37$\\{new\_row}[0]\K0.0$;\6
\&{if} $\|i>\\{mm}$ \1\&{then}\6
\&{for} $\|j\K1\mathrel{\&{to}}\\{nn}$ \1\&{do}\5
$\\{new\_row}[\|j]\K0.0$\2\6
\4\&{else} \&{for} $\|j\K1\mathrel{\&{to}}\\{nn}$ \1\&{do}\6
\&{begin} \37$\\{read}(\\{bytes\_in},\39\|t)$;\5
$\\{new\_row}[\|j]\K(255.5-\|t)/256.0$;\6
\&{end};\2\2\6
$\\{new\_row}[\\{nn}+1]\K0.0$;\6
\&{end};\par
\A sections~11 and~20.
\U section~2.\fi

\M11. Here is a procedure that ``rolls'' the buffer down eight lines:

\Y\P$\4\X10:Basic procedures\X\mathrel{+}\S$\6
\4\&{procedure}\1\  \37\\{roll};\6
\4\&{var} \37\|j: \37$0\to\\{nn}+1$;\5
\|i: \37$2\to9$;\5
\|k: \37\\{integer};\2\6
\&{begin} \37\&{for} $\|i\K6\mathrel{\&{to}}9$ \1\&{do}\6
\&{for} $\|j\K0\mathrel{\&{to}}\\{nn}+1$ \1\&{do}\6
\&{begin} \37$\\{buffer}[\|i-8,\39\|j]\K\\{buffer}[\|i,\39\|j]$;\5
$\\{darkness}[\|i-8,\39\|j]\K\\{darkness}[\|i,\39\|j]$;\6
\&{end};\2\2\6
\&{for} $\|j\K0\mathrel{\&{to}}\\{nn}+1$ \1\&{do}\5
$\\{darkness}[-3,\39\|j]\K\\{darkness}[5,\39\|j]$;\2\6
$\\{incr}(\\{ii})$;\6
\&{for} $\|i\K2\mathrel{\&{to}}9$ \1\&{do}\6
\&{begin} \37$\\{get\_in}(8\ast\\{ii}+\|i-5)$;\6
\&{for} $\|j\K0\mathrel{\&{to}}\\{nn}+1$ \1\&{do}\6
\&{begin} \37$\\{buffer}[\|i,\39\|j]\K\\{new\_row}[\|j]$;\5
$\\{darkness}[\|i,\39\|j]\K\\{white}$;\6
\&{end};\2\6
\&{end};\2\6
\&{end};\par
\fi

\M12. It's tedious but not difficult to get everything started.
We put zeros above the top lines in the picture.

\Y\P$\4\X12:Initialize the buffers\X\S$\6
$\\{ii}\K0$;\6
\&{for} $\|i\K6\mathrel{\&{to}}9$ \1\&{do}\6
\&{begin} \37$\\{get\_in}(\|i-5)$;\6
\&{for} $\|j\K0\mathrel{\&{to}}\\{nn}+1$ \1\&{do}\6
\&{begin} \37$\\{buffer}[\|i,\39\|j]\K\\{new\_row}[\|j]$;\5
$\\{darkness}[\|i,\39\|j]\K\\{white}$;\6
\&{end};\2\6
\&{end};\2\6
\&{for} $\|i\K-2\mathrel{\&{to}}5$ \1\&{do}\6
\&{for} $\|j\K0\mathrel{\&{to}}\\{nn}+1$ \1\&{do}\6
\&{begin} \37$\\{buffer}[\|i,\39\|j]\K0.0$;\5
$\\{darkness}[\|i,\39\|j]\K\\{white}$;\6
\&{end};\2\2\6
\&{for} $\|j\K0\mathrel{\&{to}}\\{nn}+1$ \1\&{do}\5
$\\{darkness}[-3,\39\|j]\K\\{white}$\2\par
\U section~26.\fi

\M13. It's easy to output the current darkness values. Here we output
eight consecutive rows.

\Y\P$\4\X13:Output the pixel values for the top eight rows of the buffer\X\S$\6
\&{for} $\|i\K-2\mathrel{\&{to}}5$ \1\&{do}\6
\&{begin} \37$\\{write}(\.{\'row(\'},\398\ast\\{ii}-5+\|i:1,\39\.{\');\ cols(%
\'})$;\5
$\\{cols\_out}\K0$;\6
\&{for} $\|j\K1\mathrel{\&{to}}\\{nn}$ \1\&{do}\6
\&{if} $\\{darkness}[\|i,\39\|j]=\\{black}$ \1\&{then}\6
\&{begin} \37\&{if} $\\{cols\_out}<15$ \1\&{then}\6
\&{begin} \37\&{if} $\\{cols\_out}>0$ \1\&{then}\5
$\\{write}(\.{\',\'})$;\2\6
$\\{incr}(\\{cols\_out})$;\6
\&{end}\6
\4\&{else} \&{begin} \37$\\{write\_ln}(\.{\',\'})$;\5
$\\{write}(\.{\'\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \'})$;\5
$\\{cols\_out}\K1$;\6
\&{end};\2\6
$\\{write}(\|j:1)$;\6
\&{end};\2\2\6
$\\{write\_ln}(\.{\');\'})$\6
\&{end}\2\par
\U section~26.\fi

\M14. \P$\X6:Global variables\X\mathrel{+}\S$\6
\4\\{cols\_out}: \37$0\to15$;\C{the number of columns output so far on this
line}\par
\fi

\N15.  Dot diffusion.
The pixels are divided into 64 classes, numbered from 0 to~63.
We convert the pixel values to
darknesses by using a method called ``dot diffusion.'' Values are assigned
first to all the pixels of class~0, then to all the pixels of class~1,
etc.; the error incurred at each step is distributed to the neighbors whose
class numbers are higher. This is done by means of precomputed tables
\\{class\_row}, \\{class\_col}, \\{start}, \\{del\_i}, \\{del\_j}, and %
\\{alpha} whose
function is easy to deduce from the following code:

\Y\P$\4\X15:Choose pixel values and diffuse the errors in the buffer\X\S$\6
\&{for} $\|k\K0\mathrel{\&{to}}63$ \1\&{do}\6
\&{begin} \37$\|i\K\\{class\_row}[\|k]$;\5
$\|j\K\\{class\_col}[\|k]$;\6
\&{while} $\|j\L\\{nn}$ \1\&{do}\6
\&{begin} \37\X17:Decide the color of pixel $[\|i,\|j]$ and the resulting %
\\{err}\X;\6
\&{for} $\|l\K\\{start}[\|k]\mathrel{\&{to}}\\{start}[\|k+1]-1$ \1\&{do}\6
\&{begin} \37$\|u\K\|i+\\{del\_i}[\|l]$;\5
$\|v\K\|j+\\{del\_j}[\|l]$;\5
$\\{buffer}[\|u,\39\|v]\K\\{buffer}[\|u,\39\|v]+\\{err}\ast\\{alpha}[\|l]$;\6
\&{end};\2\6
$\|j\K\|j+8$;\6
\&{end};\2\6
\&{end}\2\par
\U section~26.\fi

\M16. \P$\X6:Global variables\X\mathrel{+}\S$\6
\4\\{class\_row}: \37\&{array} $[0\to63]$ \1\&{of}\5
$-2\to8$;\C{buffer row containing pixels of a given class}\2\6
\4\\{class\_col}: \37\&{array} $[0\to63]$ \1\&{of}\5
$1\to8$;\C{first column containing pixels of a given class}\2\6
\4\\{class\_number}: \37\&{array} $[-2\to9,\390\to9]$ \1\&{of}\5
$0\to63$;\C{number of a given position}\2\6
\4\\{err}: \37\\{real};\C{error introduced at the current position}\6
\4\\{err\_black}: \37\\{real};\C{error introduced at the current position if
black chosen}\6
\4\\{black\_diff}: \37\\{real};\C{difference between \\{err} and \\{err\_black}
for gray pixel}\6
\4\|l: \37$0\to256$;\C{index into diffusion tables}\6
\4\\{start}: \37\&{array} $[0\to64]$ \1\&{of}\5
$0\to256$;\C{first entry of diffusion table for a given class}\2\6
\4$\\{del\_i},\39\\{del\_j}$: \37\&{array} $[0\to256]$ \1\&{of}\5
$-1\to1$;\C{neighboring location for diffusion}\2\6
\4\\{alpha}: \37\&{array} $[0\to256]$ \1\&{of}\5
\\{real};\C{constant of proportionality for diffusion}\2\par
\fi

\M17. Here we choose white or black, whichever minimizes the magnitude of the
error.
Potentially \\{gray} values of this pixel and its neighbors make this calculation
slightly
tricky, as we must subtract \\{zeta} when a gray pixel is created and add %
\\{zeta}
when it is destroyed.

\Y\P$\4\X17:Decide the color of pixel $[\|i,\|j]$ and the resulting \\{err}\X%
\S$\6
\&{if} $\\{darkness}[\|i,\39\|j]=\\{gray}$ \1\&{then}\6
\&{begin} \37$\\{err}\K\\{buffer}[\|i,\39\|j]-\\{zeta}$;\5
$\\{err\_black}\K\\{err}-\\{black\_diff}$;\6
\&{end}\6
\4\&{else} \&{begin} \37$\\{err}\K\\{buffer}[\|i,\39\|j]$;\5
$\\{err\_black}\K\\{err}-1.0$;\6
\&{end};\2\6
\&{if} $\\{darkness}[\|i-1,\39\|j]=\\{white}$ \1\&{then}\5
$\\{err\_black}\K\\{err\_black}-\\{zeta}$;\2\6
\&{if} $\\{darkness}[\|i,\39\|j-1]=\\{white}$ \1\&{then}\5
$\\{err\_black}\K\\{err\_black}-\\{zeta}$;\2\6
\&{if} $\\{darkness}[\|i,\39\|j+1]=\\{white}$ \1\&{then}\5
$\\{err\_black}\K\\{err\_black}-\\{zeta}$;\2\6
\&{if} $\\{darkness}[\|i+1,\39\|j]=\\{white}$ \1\&{then}\5
$\\{err\_black}\K\\{err\_black}-\\{zeta}$;\2\6
\&{if} $\\{err\_black}+\\{err}>0$ \1\&{then}\6
\&{begin} \37$\\{err}\K\\{err\_black}$;\5
$\\{darkness}[\|i,\39\|j]\K\\{black}$;\6
\&{if} $\\{darkness}[\|i-1,\39\|j]=\\{white}$ \1\&{then}\5
$\\{darkness}[\|i-1,\39\|j]\K\\{gray}$;\2\6
\&{if} $\\{darkness}[\|i,\39\|j-1]=\\{white}$ \1\&{then}\5
$\\{darkness}[\|i,\39\|j-1]\K\\{gray}$;\2\6
\&{if} $\\{darkness}[\|i,\39\|j+1]=\\{white}$ \1\&{then}\5
$\\{darkness}[\|i,\39\|j+1]\K\\{gray}$;\2\6
\&{if} $\\{darkness}[\|i+1,\39\|j]=\\{white}$ \1\&{then}\5
$\\{darkness}[\|i+1,\39\|j]\K\\{gray}$;\2\6
\&{end}\2\par
\U section~15.\fi

\M18. \P$\X18:Initialize the diffusion tables\X\S$\6
$\\{black\_diff}\K1.0-2.0\ast\\{zeta}$;\par
\A section~19.
\U section~26.\fi

\N19.  Computing the diffusion tables.
The tables for dot diffusion could be specified by a large number
of boring assignment statements, but it is more fun to compute them by a method
that shows some of the mysterious underlying structure.

\Y\P$\4\X18:Initialize the diffusion tables\X\mathrel{+}\S$\6
\X21:Initialize the class number matrix\X;\6
\X23:Compile ``instructions'' for the diffusion operations\X\par
\fi

\M20. The order of classes
used here is the order in which pixels might be blackened in a font
for halftones based on dots in a 45$↑\circ$ grid. In fact, this is precisely
the pattern used in the |dot300| font that was described earlier.

\Y\P$\4\X10:Basic procedures\X\mathrel{+}\S$\6
\4\&{procedure}\1\  \37$\\{store}(\|i,\39\|j:\\{integer})$;\C{establish new %
\\{class\_row}, \\{class\_col}}\2\6
\&{begin} \37\&{if} $\|i<1$ \1\&{then}\5
$\|i\K\|i+8$\ \&{else} \&{if} $\|i>8$ \1\&{then}\5
$\|i\K\|i-8$;\2\2\6
\&{if} $\|j<1$ \1\&{then}\5
$\|j\K\|j+8$\ \&{else} \&{if} $\|j>8$ \1\&{then}\5
$\|j\K\|j-8$;\2\2\6
$\\{class\_number}[\|i,\39\|j]\K\|k$;\5
$\\{class\_row}[\|k]\K\|i$;\5
$\\{class\_col}[\|k]\K\|j$;\5
$\\{incr}(\|k)$;\6
\&{end};\7
\4\&{procedure}\1\  \37$\\{store\_eight}(\|i,\39\|j:\\{integer})$;\C{rotate and
shift for eight classes}\2\6
\&{begin} \37$\\{store}(\|i,\39\|j)$;\5
$\\{store}(\|i-4,\39\|j+4)$;\5
$\\{store}(5-\|j,\39\|i)$;\5
$\\{store}(1-\|j,\39\|i-4)$;\6
$\\{store}(4+\|j,\391-\|i)$;\5
$\\{store}(\|j,\395-\|i)$;\5
$\\{store}(5-\|i,\395-\|j)$;\5
$\\{store}(1-\|i,\391-\|j)$;\6
\&{end};\par
\fi

\M21. \P$\X21:Initialize the class number matrix\X\S$\6
$\|k\K0$;\5
$\\{store\_eight}(7,\392)$;\5
$\\{store\_eight}(8,\393)$;\5
$\\{store\_eight}(8,\392)$;\5
$\\{store\_eight}(8,\391)$;\6
$\\{store\_eight}(1,\394)$;\5
$\\{store\_eight}(1,\393)$;\5
$\\{store\_eight}(1,\392)$;\5
$\\{store\_eight}(2,\393)$;\6
\&{for} $\|i\K1\mathrel{\&{to}}8$ \1\&{do}\6
\&{begin} \37$\\{class\_number}[\|i,\390]\K\\{class\_number}[\|i,\398]$;\5
$\\{class\_number}[\|i,\399]\K\\{class\_number}[\|i,\391]$;\6
\&{end};\2\6
\&{for} $\|j\K0\mathrel{\&{to}}9$ \1\&{do}\6
\&{begin} \37$\\{class\_number}[-2,\39\|j]\K\\{class\_number}[6,\39\|j]$;\5
$\\{class\_number}[-1,\39\|j]\K\\{class\_number}[7,\39\|j]$;\5
$\\{class\_number}[0,\39\|j]\K\\{class\_number}[8,\39\|j]$;\5
$\\{class\_number}[9,\39\|j]\K\\{class\_number}[1,\39\|j]$;\6
\&{end}\2\par
\U section~19.\fi

\M22. The tricky part of this process is the fact that some values near the
bottom of the buffer aren't ready for processing until errors have been
diffused from the next bufferload. In such cases we go up eight rows
to process a value that has been held over.

\Y\P$\4\X6:Global variables\X\mathrel{+}\S$\6
\4\\{hold}: \37\&{array} $[0\to9,\390\to9]$ \1\&{of}\5
\\{boolean};\C{is this value too close to the bottom 	of the buffer to allow
immediate processing?}\2\par
\fi

\M23. The ``compilation'' in this step simulates going through the diffusion
process the slow way, and records the actions it performs (so that they
can all be done at high speed later).

\Y\P$\4\X23:Compile ``instructions'' for the diffusion operations\X\S$\6
\&{for} $\|j\K0\mathrel{\&{to}}9$ \1\&{do}\5
$\\{hold}[9,\39\|j]\K\\{true}$;\2\6
\&{for} $\|i\K0\mathrel{\&{to}}8$ \1\&{do}\6
\&{for} $\|j\K0\mathrel{\&{to}}9$ \1\&{do}\5
$\\{hold}[\|i,\39\|j]\K\\{false}$;\2\2\6
$\|l\K0$;\5
$\|k\K0$;\6
\1\&{repeat} \37$\|i\K\\{class\_row}[\|k]$;\5
$\|j\K\\{class\_col}[\|k]$;\5
$\|w\K0$;\5
$\\{start}[\|k]\K\|l$;\6
\&{for} $\|u\K\|i-1\mathrel{\&{to}}\|i+1$ \1\&{do}\6
\&{for} $\|v\K\|j-1\mathrel{\&{to}}\|j+1$ \1\&{do}\6
\&{if} $\\{class\_number}[\|u,\39\|v]>\|k$ \1\&{then}\6
\&{begin} \37$\\{del\_i}[\|l]\K\|u-\|i$;\5
$\\{del\_j}[\|l]\K\|v-\|j$;\5
$\\{incr}(\|l)$;\6
\&{if} $\|u=\|i$ \1\&{then}\5
$\|w\K\|w+2$\C{neighbors in the same row get weight 2}\6
\4\&{else} \&{if} $\|v=\|j$ \1\&{then}\5
$\|w\K\|w+2$\C{neighbors in the same column get weight 2}\6
\4\&{else} $\\{incr}(\|w)$;\C{diagonal neighbors get weight 1}\2\2\6
\&{end}\6
\4\&{else} \&{if} $\\{hold}[\|u,\39\|v]$ \1\&{then}\5
$\\{hold}[\|i,\39\|j]\K\\{true}$;\2\2\2\2\6
\&{if} $\\{hold}[\|i,\39\|j]$ \1\&{then}\5
$\\{class\_row}[\|k]\K\|i-8$;\2\6
\X24:Compute the \\{alpha} values for class \|k, given the total weight \|w\X;\6
$\\{incr}(\|k)$;\6
\4\&{until}\5
$\|k=64$;\2\6
$\\{start}[64]\K\|l$\par
\U section~19.\fi

\M24. \P$\X24:Compute the \\{alpha} values for class \|k, given the total
weight \|w\X\S$\6
\&{for} $\\{ll}\K\\{start}[\|k]\mathrel{\&{to}}\|l-1$ \1\&{do}\6
\&{begin} \37\&{if} $\\{del\_i}[\\{ll}]=0$ \1\&{then}\5
$\\{alpha}[\\{ll}]\K2.0/\|w$\6
\4\&{else} \&{if} $\\{del\_j}[\\{ll}]=0$ \1\&{then}\5
$\\{alpha}[\\{ll}]\K2.0/\|w$\6
\4\&{else} $\\{alpha}[\\{ll}]\K1.0/\|w$;\2\2\6
\&{end}\2\par
\U section~23.\fi

\M25. \P$\X6:Global variables\X\mathrel{+}\S$\6
\4\\{ll}: \37$0\to256$;\C{loop index}\6
\4$\|u,\39\|v$: \37\\{integer};\C{neighbors of \|i and \|j}\6
\4\|w: \37\\{integer};\C{the weighted number of high-class neighbors}\6
\4$\|i,\39\|j$: \37\\{integer};\C{the current pixel position being considered}\6
\4\|k: \37$0\to64$;\C{the current class being considered}\par
\fi

\N26.  The main program.
Finally we're ready to get it all together.

\Y\P$\4\X26:The main program\X\S$\6
\X18:Initialize the diffusion tables\X;\6
\X7:Open the input file\X;\6
\X12:Initialize the buffers\X;\6
\1\&{repeat} \37\X15:Choose pixel values and diffuse the errors in the buffer%
\X;\6
\&{if} $\\{ii}>0$ \1\&{then}\5
\X13:Output the pixel values for the top eight rows of the buffer\X;\2\6
\\{roll};\6
\4\&{until}\5
$8\ast\\{ii}>\\{mm}$\2\par
\U section~2.\fi

\bigskip\noindent{\bf Acknowledgements.}\quad
The research described in this paper was supported in part by
the System Development Foundation and in part by National
Science Foundation grants IST-8201926, MCS-8300984, and DCR-8308109.

\vfill
% solution to "puzzle"
\input hf33
\font\halftone=hex[hf,dek]
\beginhalftone
HGEEDB?@BBB?=??<<=?<<<<<:<<<<99:<<<<<<:=@BBBBBCDDDEFFEE.
GGEEDB@@ABBA>>>=<;==<;;:9;>?@?>==<;<;<:;?ABBBBBDDDEEFEE.
EEEDC@?@ACBA>=;;::;;9888:=BDEFDA=::::9:=@ACBACCCCDCDECC.
CDDDC@???ABB?<:;:99:9777:BEGHIHGFB=9898:=>AB?ABCBCBBDBB.
CCDCB?==>AB?::9::8887768EIJKKKKJJF>87879;>@@=>@AAA@AC?@.
CBCDB?<;<>@?;999:877667:FJKLLLLLLKGA77678;=>;;=>>>>>@==.
CCCB=::::=><9998877666@HKKKLMLLLLLJD66578:;:89:;:;:<=:;.
CCBA=9999:<;:998776656AILKKLLLLLMLLKC745688987888889:99.
AB@=98878:::998766556BJLKKLLLMMMMMLKF545678877767778988.
>@?<:8878899899876555AJLKIJKLLLMMMMMLC53467777766667888.
<><:9887888778776655;JKJFDGIKLLLLLLMLD43567766656557787.
9;<:99877777777766448IJGB8;CGJLMMMMMML>4355666655456688.
:=;98877777667775446GJB64357CILMMMMMMK=3334555554456687.
:<<:8876666666665535FJ>310125AJLMMMMMMJ7223444443355577.
<>98776666667666435BJB2000015BJLMMMMMMH5222333233445577.
<>:8765556556666433>JE30000015EKMMMMMMMC422323223433466.
=<96665555565556338JI510000128HLMMMMMML?233322223333466.
<=;7654444455456425IK:10000014AJLMMMMMMK744333323322345.
=?;655323456546534CLH300000127FKMMMNNMMI675553433322344.
?BB864433345535533?KK710000014:GKLMMNMNME>7676543322233.
DFC753453344445439KLD200000125;GKMMMNMMLFC:;96753222223.
FGG@75676434433426IMH5100000125;FKMMNMNMKHCCB9995212223.
HHGA98;=743323225ELK910000011259HLNMNMMMKIFFB=?;3211222.
JIIFC>ACC86432212@LME41100123357DKMMNMNMLKIHFCBE7211222.
JIHGEEEFEB9522127IMK:231114:989DJMNMNMNMLKIGFFDE6211112.
KJIHGHGGHGE<42215GMMH876216CCBDGJLMMNMNMMLKHGGFHC511112.
JJIHIIIJIHEA3223@LMLHDD@34FHEHJKLLMNMNMMLLKJHHHI>311112.
KJJIIJJKJJGG83447JMMKHFG73EHEHKKJKMMNMNMMLLKJIIKH721112.
JKJJJJJKJIGE5687DLMLFEFD47IA@IIFFLMMNMNMMLKKJJKJE411223.
JKJJKKJLKJHI=8C@?KMMF=>D63F?6DGB9IMMNMNMMLLKKKKKJ:21123.
KKKKKKKLKJIIBGIGGLMK657626D56;96>KMNNNMNMLLKKKLKG612234.
KKKKLLLLLKJKHIKKHKMM<23422>634547IMNNNMNMLLLKKLLKD42235.
LLLLLLLLLLLLKKKKKMMK411115711126ELMMMNMMMLLKKLLLJB34455.
LLLLLLLLLLLMLLLLLLMMA20012631014CKMNMNMNMLKKKKLLKI;6677.
LMMMLLMMMMLMMLMMMMMK60011561003?JMM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NNNNN.
NONNMNNNNNNOONONOONOONOONONNNONONOONONONOONOONNNNNNNNNN.
NNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.
ONNNNMNNNNNNOONONOONOONOONOOONONONOONONONOONOONONNNNNNN.
NNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.
NONNNMMMNMMNNNMLMMNONOONOONONONONONOONONONOONOONOONNNNN.
NNNNNNMMNMMNMMLJJKLMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.
ONNNMMMNNNMMMKECEHKLMNNONOONONONONONOONONONOONOONONNNNN.
NNNNNNNNNNNMMKB8:@EIKMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.
NONNMMNMNNNMKD98;@EGJJKMNONONONONONOOOONONONOONOONONNNN.
NNNNNNNNNNNNMG>9;=ACFHHKMNNNNNNNNNNNOONNNNNNNNNNNNNNNNN.
OOONNNNNNNNMKD@>@?ADFFGILNNOONONONOONONONONONOONOONOONN.
NOONNNNNNNNNMIECDBABEEEGJLMNNNNNNNNOOONNNNNNNNNNNNNNNNN.
NNOOONNOONNNLHGFFDDDDEEFHJLMNONONONNNNONONONONOONOONONN.
NOOONNNONNNNMKJIIGEEDDDEFGIKMNNNNNNOONNNNNNNNNNNNNNNNNN.
NONOOONOOOONNLLKJHFEDDCDFFGJMNONNNNNNNNNNNOONONOONOONNN.
NOOOONOOOOONNMLLLJHFDDDCEEDFLNNNNNNNNNNNNNNNNNNNNNNNNNN.
\endhalftone
\bye